import request from '@/config/axios'

export interface ClueLogVO {
        id: number
        accountId: number
        advertiserId: string
        advertiserName: string
        promotionId: string
        promotionName: string
        clueType: number
        allocationStatus: number
        actionType: number
        clueName: string
        age: number
        telephone: string
        clueOwnerName: string
        provinceName: string
        cityName: string
        countyName: string
        address: string
        adClueId: string
}

// 查询广告线索记录列表
export const getClueLogPage = async (params) => {
    return await request.get({url: `/ad/clue-log/page`, params})
}

// 查询广告线索记录详情
export const getClueLog = async (id: number) => {
    return await request.get({url: `/ad/clue-log/get?id=` + id})
}

// 新增广告线索记录
export const createClueLog = async (data: ClueLogVO) => {
    return await request.post({url: `/ad/clue-log/create`, data})
}

// 修改广告线索记录
export const updateClueLog = async (data: ClueLogVO) => {
    return await request.put({url: `/ad/clue-log/update`, data})
}

// 删除广告线索记录
export const deleteClueLog = async (id: number) => {
    return await request.delete({url: `/ad/clue-log/delete?id=` + id})
}

// 导出广告线索记录 Excel
export const exportClueLog = async (params) => {
    return await request.download({url: `/ad/clue-log/export-excel`, params})
}